srcdir       = @srcdir@
top_builddir = @top_builddir@
top_srcdir   = @top_srcdir@

SCM_CATEGORY = parser

include ../Makefile.ext

LIBFILES = parser--peg.$(SOEXT)
SCMFILES = peg.sci peg/deprecated.scm

OBJECTS = parser--peg.$(OBJEXT)

GENERATED = Makefile
XCLEANFILES = peg.sci *.c

all : $(LIBFILES)

parser--peg.$(SOEXT) : $(OBJECTS)
	$(MODLINK) parser--peg.$(SOEXT) $(OBJECTS) $(EXT_LIBGAUCHE) $(LIBS)

parser--peg.c peg.sci : peg.scm
	$(PRECOMP) -e -P -o parser--peg \
	           --keep-private-macro=return-failure/compound,return-failure/expect,return-result \
	           $(srcdir)/peg.scm

install : install-std

